import axios from 'axios'
const instance = axios.create({
  baseURL: 'http://leju.bufan.cloud/lejuAdmin',
  timeout: 10000,
})
instance.interceptors.request.use(
  (config) => {
    config.headers.token = localStorage.getItem('token')
    return config
  },
  (error) => {
    return Promise.reject(error)
  }
)
instance.interceptors.response.use(
  (config) => {
    return config.data
  },
  (error) => {
    return Promise.reject(error)
  }
)
export default instance
